home *** CD-ROM | disk | FTP | other *** search
- #ifndef __CSHELL__
- #define __CSHELL__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
- #ifndef __MACSHELLVERSION__
- #include "MacShellVersion.h"
- #endif
-
- #ifndef __FILEFORMAT__
- #include "FileFormat.h"
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __PRINTING__
- #include <Printing.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- /********/
-
- #ifdef THINK_C
- #if THINK_C < 5
- #define THINK_PRE_5
- #endif
- #endif
-
- #ifndef THINK_PRE_5
- struct FileRec;
- typedef struct FileRec *FileRecPtr, **FileRecHndl;
-
- typedef void (*ImageProcPtr)(FileRecHndl frHndl);
- typedef void (*ContentClickProcPtr)(WindowPtr window, EventRecord *event);
- typedef void (*ContentKeyProcPtr)(WindowPtr window, EventRecord *event);
- typedef OSErr (*InitContentProcPtr)(FileRecHndl frHndl, WindowPtr window);
- typedef void (*ResizeContentProcPtr)(WindowPtr window, short oldh, short oldv);
- typedef void (*DrawFrameProcPtr)(FileRecHndl frHndl, WindowPtr window);
- typedef void (*CalcFrameRgnProcPtr)(FileRecHndl frHndl, WindowPtr window, RgnHandle rgn);
- #endif
-
- typedef struct {
- OSType sfType;
- Boolean docDirty;
- Boolean readOnly;
- short refNum;
- FSSpec fss;
- WindowPtr window;
- #if THINK_PRE_5
- ProcPtr imageProc;
- ProcPtr contentClickProc;
- ProcPtr contentKeyProc;
- ProcPtr initContentProc;
- ProcPtr resizeContentProc;
- ProcPtr drawFrameProc;
- ProcPtr calcFrameRgnProc;
- #else
- ImageProcPtr imageProc;
- ContentClickProcPtr contentClickProc;
- ContentKeyProcPtr contentKeyProc;
- InitContentProcPtr initContentProc;
- ResizeContentProcPtr resizeContentProc;
- DrawFrameProcPtr drawFrameProc;
- CalcFrameRgnProcPtr calcFrameRgnProc;
- #endif
- short attributes;
- ControlHandle hScroll;
- ControlHandle vScroll;
- short hArrowVal;
- short vArrowVal;
- short hPageVal;
- short vPageVal;
- short hDocSize;
- short vDocSize;
- } FileStateRec;
-
- typedef struct {
- long windowID[2]; /* Used to match up windows. */
- short endSendInfo; /* Above is send info. */
-
- Boolean connected; /* Flag showing we are connected. */
- AEAddressDesc remoteLoc; /* AppleEvents address of remote user. */
- Str32 remoteName; /* Name of user connected to. */
- Str32 remoteZone; /* Zone of user connected to. */
- Str32 remoteMachine; /* Machine name of user connected to. */
- short endLocalInfo; /* Above info is for one machine only. */
- } ConnectRec;
-
- typedef struct FileRec {
- FileStateRec fileState;
- ConnectRec connect;
- TheDoc doc;
- } FileRec;
- #if THINK_PRE_5
- typedef struct FileRec *FileRecPtr, **FileRecHndl;
- #endif
-
- struct triplets{
- AEEventClass theEventClass;
- AEEventID theEventID;
- ProcPtr theHandler;
- };
- typedef struct triplets triplets;
-
-
-
- /********/
-
- #define kwGrowIcon 1
- #define kwHScroll 2
- #define kwHScrollLessGrow 6
- #define kwVScroll 8
- #define kwVScrollLessGrow 24
-
- #define kwAppWindow (kwGrowIcon)
-
- #define kCustomEventClass 'CUST'
- #define keyAppMessage 'KMSG'
- #define keyFSS 'KFSS'
- #define keyPascal 'PSTR'
- #define keyAppConnect 'KCNT'
- #define keyWindowID 'KWND'
-
- #define typeAppConnect 'KCNT'
- #define typeAppMessage 'KMSG'
- #define typeDoubleLong 'DBLL'
- #define typePascal 'PSTR'
- #define typeTextMessage 'KTXT'
-
- #define keyReplyErr 'errn'
-
- #define kVersion 100
- #define kWrongVersion 100
-
- #define kInvalVRefNum 0
-
- #define kSaveYes 1
- #define kSaveNo 3
- #define kSaveCanceled 4
-
- #define kOpenYes 1
- #define kOpenNo 3
-
- #define kDisconnectMssg 0
- #define kTextMssg 1
-
- #define kMaxNumWindows 65535
- #define kMinWindowWidth 200
- #define kMinWindowHeight 200
- #define kMaxWindowWidth 2000
- #define kMaxWindowHeight 2000
-
- #endif __CSHELL__
-